home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / ca29_1.zip / REGISTER.CMD < prev    next >
OS/2 REXX Batch file  |  1992-06-29  |  2KB  |  58 lines

  1. ; ----- Print a registration form (REGISTER.FRM) ------------------
  2. ;    ----------------------------------------
  3. ;    Open the form-file
  4. ;
  5.     SET FLAG(9) OFF            ; Clear ESC flag
  6.     ON ESCAPE GOSUB Escape        ; Set ESC handler
  7.     FOPENI "register.frm" text
  8.     IF FAILED
  9.        WOPEN 10,1  12,78 (default) ESCAPE
  10.        ATSAY 10,3  (default) " Print Registration "
  11.        ATSAY 11,3  (default) "REGISTER.FRM is not on the current subdirectory."
  12.        ATSAY 12,29 (default) " Press any key to exit "
  13.        KEYGET S0            ; Wait for any key
  14.        WCLOSE            ; Close open window
  15.        GOTO Exit            ; Exit if ESC
  16.        ENDIF
  17. ;
  18. ;    Wait for the printer to be prepared...
  19. ;
  20.     WOPEN 10,1  12,78 (default) ESCAPE
  21.     ATSAY 10,3  (default) " Print Registration "
  22.     ATSAY 11,3  (default) "Please prepare the printer.  Press any key to start."
  23.     ATSAY 12,30 (default) " Press ESC to cancel "
  24.     KEYGET S0            ; Wait for any key
  25.     WCLOSE                ; Close open window
  26.     IF FLAG(9) GOTO Exit        ; Exit if ESC
  27.     GOTO Start
  28. ;
  29. ; ----- Subroutine: ESC handler: Close open windows and exit script
  30. ;
  31. Escape:
  32.     SET FLAG(9) ON            ; Mark ESC pressed
  33.     RETURN
  34. ;
  35. ; ----- Exit routine
  36. ;
  37. Exit:
  38.     IF FCALLED FRET            ; Return if fcalled
  39.     EXIT
  40. ;
  41. ; ----- Print registration form
  42. ;
  43. Start:
  44.     READ S0 80 N0            ; Read a line of the form
  45.     IF NOT EOF            ; If not end-file
  46.        PRESERVE S0            ; Preserve !s ^s and `s
  47.        PRINT S0&""            ; Print the line
  48.        PRINT "^M^J"            ; .. and a cr/lf
  49.        IF FLAG(9) GOTO Exit        ; Exit on Escape
  50.        GOTO Start            ; Loop until EOF
  51.        ENDIF
  52. ;
  53. ;    End-File on input
  54. ;
  55.     PRINT "^L"            ; Print a final tof
  56.     FCLOSEI                ; Close input file
  57.     GOTO Exit            ; And done
  58.